<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
    <script src="js/jquery.min.js"></script>
</head>
<style>
    p{
        margin:6px auto;
        padding:5px;
    }
</style>
<body>
<div style="width:800px;height:200px;margin:0 auto;border:2px solid #ccc;">
    <h2 style="text-align:center;">App压缩文件上传</h2>
<form action="http://47.104.158.3:8080/v1.0/user/brand/androidapp/upload" method="post" enctype="multipart/form-data">
    文件：  <input type="file"  name="android"/>
    贴牌id：<input class="form-control"  name="brand_id" id="brand_id"/>
           <input class="btn btn-default" type="submit"  id="submit" value="提交"/>
</form>
</div>
<div style="width:800px;height:auto;margin:0 auto;border:2px solid #ccc;">
    <h2 style="text-align:center;">根据品牌查询版本号和地址</h2>
    <p>品牌编号：<!--<input type="text" id="brand" class="form-control">-->
            <select id="brand" class="form-control">
                <option value="1">赚道钱包</option>
                <option value="2">节付宝</option>
                <option value="3">闪付</option>
                <option value="4">星星钱包</option>
                <option value="5">联码钱包</option>
                <option value="6">卓顶钱包</option>
                <option value="7">谷收钱包</option>
                <option value="8">节付宝8</option>
                <option value="9">节付宝9</option>
                <option value="10">节付宝10</option>
                <option value="11">节付宝11</option>
            </select>
    </p>
    <p><button id="bt" class="btn btn-default">查询</button></p>
    <h2 style="text-align:center;">版本号和地址修改</h2>
    <p>品牌编号：<input id="brandid" type="text" class="form-control"></p>
    <p>极光APP密匙：<input id="appkey" type="text" class="form-control"></p>
    <p>极光APP推送密匙：<input id="mas" type="text" class="form-control"></p>
    <p>短信发送码：<input id="msg" type="text" class="form-control"></p>
    <p>Android版本号：<input id="av" type="text" class="form-control"></p>
    <p>Android下载地址：<input id="ad" type="text" class="form-control"></p>
    <p>IOS版本号：<input id="iv" type="text" class="form-control"></p>
    <p>IOS下载地址：<input id="id" type="text" class="form-control"></p>
    <p><input type="button" id="btn" value="提交" class="btn btn-default"></p>
</div>
</body>
<script>
    $(function(){
        $('#bt').click(function(){
                var x = $('#brand').val();
            $.ajax({
                type:"GET",
                url: window.baseUrl+"user/brand/query/id",
                async:true,
                dataType:"json",
                data:{
                    brand_id:x,
                },
                success:function(data){
                    alert('成功');
                    console.log(data.result);
                    $('#brandid').val(data.result.id);
                    $('#appkey').val(data.result.appkey);
                    $('#mas').val(data.result.mastersecret);
                    $('#msg').val(data.result.tplid);
                    $('#av').val(data.result.androidVersion);
                    $('#ad').val(data.result.androidDownload);
                    $('#iv').val(data.result.iosVersion);
                    $('#id').val(data.result.iosDownload);
                    $('#brand_id').val(data.result.id)
                },
                error:function(data){
                    alert('失败')
                }
            });
        });
        $('#btn').click(function(){
                var a = $('#brandid').val();
                var b = $('#appkey').val();
                var c = $('#mas').val();
                var d = $('#msg').val();
                var e = $('#av').val();
                var f = $('#ad').val();
                var g = $('#iv').val();
                var h = $('#id').val();

                $.ajax({
                    type:"POST",
                    url:window.baseUrl+"user/brand/version/update",
                    async:true,
                    dataType:"json",
                    data:{
                        brand_id:a,
                        appkey:b,
                        mastersecret:c,
                        tplid:d,
                        androidVersion:e,
                        download_android:f,
                        iosVersion:g,
                        download_ios:h
                    },
                    success:function(data){
                        alert('成功')
                        console.log(data)
                    },
                    error:function(data){
                        alert('失败')
                    }
                });

        })
    });
</script>
</html>